import { IsEmail, IsNotEmpty, MinLength } from "class-validator";

export class RegisterDto {
  @IsNotEmpty({
    message: '用户名不能为空'
  })
  username: string;

  @IsNotEmpty({
    message: '呢称不能为空'
  })
  nickName: string;

  @IsNotEmpty({
    message: '密码不能为空'
  })
  @MinLength(6, {
    message: '密码长度最小为6位数'
  })
  password: string;

  @IsNotEmpty({
    message: '邮箱不能为空'
  })
  @IsEmail({}, {
    message: '不是合法的邮箱'
  })
  email: string;

  @IsNotEmpty({
    message: '验证码不能为空'
  })
  captcha: string;

  @IsNotEmpty({
    message: '请上传头像'
  })
  headPic: string
}